﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kindohm.Life.Library
{
    public class CorpseFinder : ProximityFinder
    {
        public Corpse FindIdealCorpse(Board board, Point start, int maxRange)
        {
            BoardObject item = this.FindNearestItem<BoardObject>(board, start, maxRange);
            Corpse corpse = item as Corpse;
            return corpse;
        }

        protected override bool ObjectIsValid<T>(T item)
        {
            Corpse corpse = item as Corpse;
            if (corpse == null)
            {
                return false;
            }
            if (corpse.Nutrition == 0)
            {
                return false;
            }
            return true;
        }
    }
}
